package com.unicom.office.node;

import com.unicom.office.func.FuncCommon;
import com.unicom.office.type.DocTableTypeItem;
import com.unicom.office.type.ParagraphTypeItem;
import com.unicom.office.type.SectionTypeItem;
import com.unicom.office.type.TypeItem;
import com.unicom.office.unit.OfficeUnit;
import com.unicom.office.unit.SectionUnit;

public class SectionNode extends OfficeNode {
    public SectionNode(Object source) {
        super(source);
    }

    public OfficeUnit createUnit() {
        return new SectionUnit();
    }

    public boolean testChildType(FuncCommon child) {
        return child.getType() == ParagraphTypeItem.INSTANCE || child.getType() == DocTableTypeItem.INSTANCE;
    }

    public TypeItem getType() {
        return SectionTypeItem.INSTANCE;
    }
}
